// 该文件专门用于创建整个应用的路由器
import About from "../pages/About";
import Home from "../pages/Home";
import News from "../pages/News";
import Message from "../pages/Message";
import Detail from "../pages/Detail";
import { createRouter, createWebHashHistory } from "vue-router";
import { name } from "pubsub-js";

const routes = [
    //一级路由
    {
        name:'guanyu',
        path: '/about',
        component: About
    },
    {
        path: '/home',
        component: Home,
        children:[
            {
                path: 'news',
                component: News
            },
            {
                path: 'message',
                component: Message,
                children:[
                    {
                        name:'xiangqing',
                        path: 'detail',
                        component: Detail
                    }
                ]
            },
        ]
    }
]

const router = createRouter({
    history: createWebHashHistory(process.env.BASE_URL),
    routes
})
export default router;